package com.woniuxy.dao;

import com.woniuxy.pojo.McarParking;
import com.woniuxy.vo.McarParkingVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface McarParkingMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(McarParking record);

    int insertSelective(McarParking record);

    McarParking selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(McarParking record);

    int updateByPrimaryKey(McarParking record);

    List<McarParking> findAllcarsBypid(McarParkingVo mcarParkingVo);
    @Update("update mcar_parking set state=#{state}  where id=#{id}")
    void setParkingState(@Param("state")  String state,@Param("id")  Integer id);
    @Update("update mcar_parking set u_state=#{uState}  where id=#{id}")
    void setParkinguState(@Param("id") Integer id, @Param("uState") String uState);
    @Update("update mcar_parking set pState=#{pState}  where id=#{id}")
    void setParkingpState(@Param("id") Integer id,@Param("state")  String pState);

    List<McarParking> findAllcarsBypids(McarParking x);
    @Select("select * from mcar_parking where pid=#{pid}")
    List<McarParking> findUserByuid(Integer pid);
   @Insert("insert into mcar_parking(address,u_state,price,pid,p_state) values(#{address},#{uState},#{price},#{pid},#{pState}) ")
    void addcar(McarParking mcarParking);
}